package com.worthtech.billportal.bean.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the bill_detail table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="bill_detail"
 */

public abstract class BaseBillDetail  implements Serializable {

	public static String REF = "BillDetail";
	public static String PROP_AMOUNT = "Amount";
	public static String PROP_ACCOUNTNAME = "Accountname";
	public static String PROP_BANKCARD = "Bankcard";
	public static String PROP_CHARGES = "Charges";
	public static String PROP_BILL_MASTER = "billMaster";
	public static String PROP_SUBTOTAL = "Subtotal";
	public static String PROP_ID = "Id";


	// constructors
	public BaseBillDetail () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseBillDetail (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseBillDetail (
		java.lang.Integer id,
		java.lang.String accountname,
		float amount,
		float charges,
		float subtotal) {

		this.setId(id);
		this.setAccountname(accountname);
		this.setAmount(amount);
		this.setCharges(charges);
		this.setSubtotal(subtotal);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String accountname;
	private float amount;
	private float charges;
	private float subtotal;
	private java.lang.String bankcard;

	// one to one
	private com.worthtech.billportal.bean.BillMaster billMaster;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="foreign"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: accountname
	 */
	public java.lang.String getAccountname () {
		return accountname;
	}

	/**
	 * Set the value related to the column: accountname
	 * @param accountname the accountname value
	 */
	public void setAccountname (java.lang.String accountname) {
		this.accountname = accountname;
	}



	/**
	 * Return the value associated with the column: amount
	 */
	public float getAmount () {
		return amount;
	}

	/**
	 * Set the value related to the column: amount
	 * @param amount the amount value
	 */
	public void setAmount (float amount) {
		this.amount = amount;
	}



	/**
	 * Return the value associated with the column: charges
	 */
	public float getCharges () {
		return charges;
	}

	/**
	 * Set the value related to the column: charges
	 * @param charges the charges value
	 */
	public void setCharges (float charges) {
		this.charges = charges;
	}



	/**
	 * Return the value associated with the column: subtotal
	 */
	public float getSubtotal () {
		return subtotal;
	}

	/**
	 * Set the value related to the column: subtotal
	 * @param subtotal the subtotal value
	 */
	public void setSubtotal (float subtotal) {
		this.subtotal = subtotal;
	}



	/**
	 * Return the value associated with the column: bankcard
	 */
	public java.lang.String getBankcard () {
		return bankcard;
	}

	/**
	 * Set the value related to the column: bankcard
	 * @param bankcard the bankcard value
	 */
	public void setBankcard (java.lang.String bankcard) {
		this.bankcard = bankcard;
	}



	/**
	 * Return the value associated with the column: billMaster
	 */
	public com.worthtech.billportal.bean.BillMaster getBillMaster () {
		return billMaster;
	}

	/**
	 * Set the value related to the column: billMaster
	 * @param billMaster the billMaster value
	 */
	public void setBillMaster (com.worthtech.billportal.bean.BillMaster billMaster) {
		this.billMaster = billMaster;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.worthtech.billportal.bean.BillDetail)) return false;
		else {
			com.worthtech.billportal.bean.BillDetail billDetail = (com.worthtech.billportal.bean.BillDetail) obj;
			if (null == this.getId() || null == billDetail.getId()) return false;
			else return (this.getId().equals(billDetail.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}